"""Base class for commands."""

class Command(object):

    """Base command class.

    Subclasses must set the `name` attribute on the class.
    Subclasses should add an OptionGroup in add_options.

    :IVariables:
        - `site`: The `hcp.site.main.Site` instance.
        - `name`: The name of the command.
    """

    def __init__(self, site):
        self.site = site

    def run(self):
        """Runs the command.

        Subclasses must implement this.
        """
        raise NotImplementedError

    def add_options(self, parser):
        """Add command-line options.

        :Parameters:
            - `parser`: The optparse parser.
        """
        return

